<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<s:if test="book==null || book.bookID == null">
	<s:set name="title" value="%{getText('label.AddNewbook')}"/>
</s:if>
<s:else>
	<s:set name="title" value="%{getText('label.UpdateNewbook')}"/>
</s:else>

<html>
<head>
    <link href="<s:url value='/css/main.css'/>" rel="stylesheet" type="text/css"/>
<style type="text/css">
body {
	font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, Arial,
		Helvetica, sans-serif;
	font-size: 12px;
}
.h1 {
    font-size: 14px;
    font-weight: bold;
}
.spacer {
	clear: both;
	height: 1px;
}
/* http://woork.blogspot.com/2008/06/clean-and-pure-css-form-design.html */
/* ----------- My Form ----------- */
.myform {
	margin: 0 auto;
	width: 640px;
	padding: 14px;
}

/* ----------- stylized ----------- */
#stylized {
	border: solid 2px #b7ddf2;
	background: #ebf4fb;
}

#stylized p {
	font-size: 11px;
	color: #666666;
	margin-bottom: 20px;
	border-bottom: solid 1px #b7ddf2;
	padding-bottom: 10px;
}

#stylized label {
	display: block;
	font-weight: bold;
	text-align: right;
	width: 140px;
	float: left;
}

#stylized .small {
	color: #666666;
	display: block;
	font-size: 11px;
	font-weight: normal;
	text-align: right;
	width: 140px;
}

#stylized input, select {
	float: left;
	font-size: 12px;
	padding: 4px 2px;
	border: solid 1px #aacfe4;
	width: 200px;
	margin: 2px 0 20px 10px;
}

#stylized button {
	clear: both;
	margin-left: 150px;
	width: 125px;
	height: 31px;
	background: #666666 url(img/button.png) no-repeat;
	text-align: center;
	line-height: 31px;
	color: #FFFFFF;
	font-size: 11px;
	font-weight: bold;
}
</style>
<title><s:property value="#title"/></title>
    
</head>
<body>

<s:actionerror />
<s:actionmessage />
<center><h1><s:property value="#title"/></h1></center>
<div id="stylized" class="myform">
<s:form action="books!save.action" method="post" >
    <s:textfield name="book.bookName" value="%{book.bookName}" label="%{getText('label.bookName')}" size="40"/>
    <s:textfield name="book.bookSN" value="%{book.bookSN}" label="%{getText('label.bookSN')}" size="40"/>
    <s:textfield name="book.author" value="%{book.author}" label="%{getText('label.author')}" size="20"/>
    <s:select name="book.category" label="%{getText('label.category')}" 
    		emptyOption="false" list="categories" listKey="categoryId" listValue="categoryName">
    </s:select>
    <s:textfield name="book.tags" value="%{book.tags}" label="%{getText('label.tags')}" size="20"/>
    <s:textfield name="book.count" value="%{book.count}" label="%{getText('label.count')}" size="20"/>
    <s:textfield name="book.publishDate" value="%{book.publishDate}" label="%{getText('label.publishDate')}" size="20"/>
    <s:hidden name="book.bookId" value="%{book.bookId}"/>
    <s:submit type="button"  value="%{getText('button.label.submit')}"/>
</s:form>
</div>
</body>
</html>